/*
 * Copyright (c) 2020 - present, Inspur Genersoft Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package com.inspur.edp.lcm.metadata.spi;

import com.inspur.edp.lcm.metadata.api.entity.GspMetadata;
import com.inspur.edp.lcm.metadata.api.entity.MetadataType;
import com.inspur.edp.lcm.metadata.spi.entity.MetadataDependencyDetail;
import com.inspur.edp.lcm.metadata.spi.entity.MetadataElement;
import com.inspur.edp.lcm.metadata.spi.entity.MetadataElementLocator;
import io.iec.edp.caf.multicontext.annotation.Collect;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 元数据内容节点操作SPI接口类
 *
 * @author sunhongfei01
 */
@Collect
public interface MetadataElementService {
    /**
     * 获取当前操作类适配元数据类型
     * 元数据类型参考{@link MetadataType#getTypeCode()}
     * @return 适配元数据类型
     */
    String getMetadataType();

    /**
     * 根据内容节点标识类 批量获取对应的内容节点
     *
     * @param locators 内容节点标识类列表
     * @return 内容节点标识类及内容节点的映射表
     */
    Map<MetadataElementLocator, MetadataElement> getMetadataElement(GspMetadata metadata, Set<MetadataElementLocator> locators);

    /**
     * 获取元数据中的依赖关系及详情
     * @param metadata 待获取依赖关系详情的元数据
     * @return 获取依赖元数据及内容依赖列表
     */
    List<MetadataDependencyDetail> getMetadataDependencyDetails(GspMetadata metadata);
}
